import datetime

from django.shortcuts import render


# Create your views here.
def index(request):
    '''
    模板语法：
    变量：{{}}
        1 深度查询  句点符
        2 过滤器  {{val|filter_name:参数}}
    标签：{%%}
    :param request:
    :return:
    '''
    name = 'yuan'
    i = 10
    l = [111, 222, 333]
    info = {'name': 'yuan', 'age': 22}
    b = True

    class Person(object):
        def __init__(self, name, age):
            self.name = name
            self.age = age

    alex = Person('alex', 35)
    egon = Person('egon', 33)

    person_list = [alex, egon]
    now = datetime.datetime.now()
    empty_list = []
    file_size = 1024 * 1024
    text = 'Where there is a will, there is a way.'
    link = '<a href="http://www.baidu.com">Click</a>'
    user = 'chenjo'

    # return render(request, 'index.html', {'name': name})
    return render(request, 'index.html', locals())


def login(request):
    return render(request, 'login.html')


def orders(request):
    return render(request, 'orders.html')
